About: "Extends ArcView to support ERDAS IMAGINE images (v3.1)."
LoadScript: 3
CanUnloadScript: 4
UnloadScript: 5
InstallScript: 6
UninstallScript: 7
ExtVersion: 3100
)
(Script.2
Name: "Imagine.ObjectsPresent"
SourceCode: "theProject = av.GetProject\nif (theProject = nil) then\n return FALSE\nend\n\nfor each e in Clipboard.The\n if (e.Is(ITheme)) then\n theImgSrc = e.GetImgSrc\n theSrcName = theImgSrc.GetSrcName\n if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"img\"))) then\n return TRUE\n end\n else\n if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"img\")) then\n return TRUE\n end\n end\n elseif (e.Is(ViewFrame) and e.IsF
illed) then\n for each aTheme in e.GetView.GetThemes\n if (aTheme.Is(ITheme)) then\n theImgSrc = aTheme.GetImgSrc\n theSrcName = theImgSrc.GetSrcName\n if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"img\"))) then\n return TRUE\n end\n else\n if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"img\")) then\n return TRUE\n end\n end\n end\n end\n else
if (e.Is(PictureFrame) and e.IsFilled and e.IsFilledBy(FileName)) then\n theFillObj = e.GetFillObject\n if (ISrc.IsValidFileName(theFillObj)) then\n theISrc = ISrc.Make(SrcName.Make(theFillObj.AsString))\n if (theISrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"img\")) then\n return TRUE\n end\n end\n end\nend\ntheDocs = av.GetProject.GetDocs\nfor each aDoc in theDocs\n if (aDoc.Is(View)) then\n for each aTheme in aDoc.GetThemes\n if (aTheme.Is(ITheme)) then\n theImgSrc = aTheme
.GetImgSrc\n theSrcName = theImgSrc.GetSrcName\n if (ImgCat.IsValidFileName(theSrcName.GetFileName)) then\n if (theImgSrc.ContainType(ISrc.ReturnTypeFromFileExt(\"img\"))) then\n return TRUE\n end\n else\n if (theImgSrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"img\")) then\n return TRUE\n end\n end\n end\n end\n elseif (aDoc.Is(Layout)) then\n for each aGraphic in aDoc.GetGraphics\n if (aGraphic.Is(PictureFrame) and aGraphi
c.IsFilled and aGraphic.IsFilledBy(FileName)) then\n theFillObj = aGraphic.GetFillObject\n if (ISrc.IsValidFileName(theFillObj)) then\n theISrc = ISrc.Make(SrcName.Make(theFillObj.AsString))\n if (theISrc.ReturnType = ISrc.ReturnTypeFromFileExt(\"img\")) then\n return TRUE\n end\n end\n elseif (aGraphic.Is(ViewFrame) and aGraphic.IsFilled) then\n for each aTheme in aGraphic.GetView.GetThemes\n if (aTheme.Is(ITheme)) then\n theImgS
SourceCode: "' Add .img to the ISrc extension list\nextn_list = ISrc.ReturnExtensions\nextn_list = extn_list.Add(\"img\".AsString)\nISrc.SetExtensions(extn_list)"
)
(Script.4
Name: "Imagine.CanUnload"
SourceCode: "' Run script Imagine.ObjectsPresent to see if there is any ImgSrc in any View with a .img extension.\n' Return result to boolean variable.\nobjectsPresent = av.Run(\"Imagine.ObjectsPresent\", NIL)\n\n' If objectsPresent is TRUE the dll should not be unloaded\nreturn objectsPresent.Not\n"
)
(Script.5
Name: "Imagine.Unload"
SourceCode: "' Remove .img to the ISrc extension list\nextn_list = ISrc.ReturnExtensions\nimgIndex = extn_list.FindByValue(\"img\")\nif (imgIndex = -1) then return NIL end\nextn_list.Remove(imgIndex)\nISrc.SetExtensions(extn_list)"